/**
 * Created by YIn on 2017/11/27.
 */
$(function(){
    var flux = echarts.init(document.getElementById('flux'));
    var flux_option = {
        // backgroundColor: '#060f4c',
        series: [{
            type: 'pie',
            radius: ['45%', '75%'],
            silent: true,
            data: [{
                value: 1,
                itemStyle: {
                    normal: {
                        color: '#050f58',
                        borderColor: '#162abb',
                        borderWidth: 2,
                        shadowBlur: 50,
                        shadowColor: 'rgba(21,41,185,.75)'
                    }
                }
            }]
        }, {
            type: 'pie',
            radius: ['45%', '75%'],
            silent: true,
            label: {
                normal: {
                    show: false,
                }
            },
            data: [{
                value: 1,
                itemStyle: {
                    normal: {
                        color: '#050f58',
                        shadowBlur: 50,
                        shadowColor: 'rgba(21,41,185,.75)'
                    }
                }
            }]
        }, {
            name: '占比',
            type: 'pie',
            radius: ['49%', '72%'],
            hoverAnimation: false,

            data: [{
                value: 70,
                name: '电信',
                itemStyle: {
                    normal: {
                        label: {
                            show: true,
                            // textStyle: {
                            // 	fontSize: 25,
                            // 	fontWeight: 'blod'
                            // },
                            position: 'center'
                        },
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(5,193,255,1)'
                        }, {
                            offset: 1,
                            color: 'rgba(15,15,90,1)'
                        }])
                    }
                },
                label: {
                    normal: {
                        position: 'outside',
                        textStyle: {
                            color: '#fff',
                            fontSize: 15
                        },
                        formatter: '58.210.183.1\n\n  {a}: {c}%'
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 20,
                        length2: 30,
                        smooth: false,
                        lineStyle: {
                            width: 1,
                            color: '#2141b5'
                        }
                    }
                }
            }, {
                value: 30,
                name: '电信专线',
                itemStyle: {
                    normal: {
                        label: {
                            show: true,
                            // textStyle: {
                            // 	fontSize: 15,
                            // 	fontWeight: 'blod'
                            // },
                            position: 'center'
                        },
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(5,15,88,1)'
                        }, {
                            offset: 1,
                            color: 'rgba(235,122,255,1)'
                        }])
                    }
                },
                label: {
                    normal: {
                        position: 'outside',
                        textStyle: {
                            color: '#fff',
                            fontSize: 15
                        },
                        formatter: '218.4.114.185  \n\n{a}: {c}%'
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 20,
                        length2: 40,
                        smooth: false,
                        lineStyle: {
                            width: 1,
                            color: '#2141b5'
                        }
                    }
                }
            }]
        }, {
            name: '',
            type: 'pie',
            clockWise: true,
            hoverAnimation: false,
            radius: [200, 200],
            label: {
                normal: {
                    position: 'center',
                    fontSize: 15
                }
            },
            data: [{
                value: 0,
                label: {
                    normal: {
                        formatter: '104Mbps',
                        textStyle: {
                            color: '#fe8b53',
                            // fontSize: 15,
                            fontWeight: 'blod'
                        }
                    }
                }
            }, {
                tooltip: {
                    show: false
                },
                label: {
                    normal: {
                        formatter: '\n总宽带',
                        textStyle: {
                            color: '#bbeaf9',
                            fontSize: 15
                        }
                    }
                }
            }]
        }]
    };
    flux.setOption(flux_option);
    window.addEventListener("resize", function () {
        flux.resize();
    });
});